home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 4.1 KB | 112 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Originator: Kent Sandvik
- Date: Wednesday, June 10, 1992 22:37:24
- Revision comments are at the end of this file.
- ---
- TFoo is an xxx class (••• describe the class in one sentence •••)
- Template.h contains the header file information for the TFoo class (••• describe the file here •••).
- _________________________________________________________________________________________________________ */
-
- // ••• Define the label so the file will be included only once. Note that
- // ••• we use only one _ instead of two in order to conform to the ANSI specs.
- // ••• Also don't forget the last #endif at the end of the file!
-
- #ifndef _FOO_
- #define _FOO_
-
- // ••• This is the only header file we always need to include, it contains the
- // ••• global headers, structures and functions for all classes.
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
- // ••• Specify below all the needed Macintosh toolbox interfaces - don't just
- // ••• include one file and assume that this file will include more files.
- // ••• Each header file should be self-contained.
- // Toolbox Include Files
- #ifndef __PROCESSES__
- #include <Processes.h>
- #endif
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
-
- // ••• Specify any global structures and enums/typedefs here
- // Global structures, typdefs and enums
-
- const ProcessSerialNumber kMyProcess = {
- kNoProcess, kNoProcess};
-
-
- // ••• Here is the start of the class definition. Each file should only have
- // ••• one class definition, unless we are dealing with really small classes.
- // ••• Why are all member functions virtual? It's for SLM support, and developers could change this easily.
- // _________________________________________________________________________________________________________ //
- // TFoo Class Interface
-
- class TFoo
- {
- // ••• Provide information about the TFoo class here - this because using a browser we
- // ••• will have information needed concerning how to use the class.
- public:
- // ••• This section will contain any class specific typedefs and enums. The reason
- // ••• it's the first section has to do with C++, you need to specify enums and
- // ••• typedefs before using them…
- // TYPEDEFS AND ENUMS
- enum EConstants
- {
- kFirstThing = 1, kLastThing = 999
- };
-
- // ••• Here we will specify all the constructors and destructors needed
- // CONSTRUCTORS & DESTRUCTOR
- TFoo(); // default constructors
- virtual~ TFoo(); // virtual destructor
-
- // ••• This section will contain the main interfaces to the class itself.
- // MAIN INTERFACE
- virtual Boolean KillApplication(ProcessSerialNumber*);// quit the application
- virtual short GetNumProcesses(); // get the N amount of currently running procs
-
- // ••• This section will contain the get and set member functions.
- // PUBLIC ACCESSORS AND MUTATORS
- virtual ProcessSerialNumber GetMyProcessID() const;
-
- // ••• This section will contain possible iterators, note the keywords Next, Last, First and Reset.
- // ITERATORS
- virtual void Next(); // next PSN
- virtual Boolean Last(); // last PSN?
- virtual void First(); // first PSN
- virtual void Reset(); // reset the list to the last entry
-
- // ••• This section will contain fields inside the class.
- // FIELDS
- protected:
- ProcessSerialNumber fProcessID; // any specific PSN number
- ProcessSerialNumber fMyProcessID; // our PSN number
- ProcessSerialNumber fFirstPSN; // the first one we got
- Boolean fFirstTime; // signals order of iterators
- Boolean fLast; // used to signal last process in an iterator list
- private:
- Boolean fState; // state of the object
- OSErr fError; // latest toolbox error
- };
-
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 6/10/92 New file
- 2 khs 7/6/92 First decent working class
- */
-
-
-